<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增模型')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-model-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">模型名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">模型key：</label>
                <div class="col-sm-8">
                    <input name="modelKey" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">模型描述：</label>
                <div class="col-sm-8">
                    <textarea name="description" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">模型评论：</label>
                <div class="col-sm-8">
                    <textarea name="modelComment" class="form-control"></textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">模型类型：</label>
                <div class="col-sm-10">
                    <div class="radio-box" th:each="dict : ${@dict.getType('flow_model_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="modelType" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/model"
        $("#form-model-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-model-add').serialize());
            }
        }
    </script>
</body>
</html>